{{!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
}}
{{yield}}
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="jobInfo">
    <div class="panel panel-default">
      <div class="panel-body">
        <div class="row">
          <div class="col-md-12">
            <div class="col-md-2">Job Id</div>
            <div class="col-md-10">{{id}}</div>
          </div>
          <div class="col-md-12">
            <div class="col-md-2">Status</div>
            <div class="col-md-10">{{model.status}}</div>
          </div>
          <div class="col-md-12">
            <div class="col-md-2">User</div>
            <div class="col-md-10">{{model.user}}</div>
          </div>
          <div class="col-md-12">
            <div class="col-md-2">Group</div>
            <div class="col-md-10">{{model.group}}</div>
          </div>
          <div class="col-md-12">
            <div class="col-md-2">App Path</div>
            <div class="col-md-10" id="job-detail-app-path">{{model.bundleJobPath}}</div>
          </div>
          <div class="col-md-12">
            <div class="col-md-2">Created Time</div>
            <div class="col-md-10">{{model.createdTime}}</div>
          </div>
          <div class="col-md-12">
            <div class="col-md-2">KickOff Time</div>
            <div class="col-md-10">{{model.kickoffTime}}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div role="tabpanel" class="tab-pane" id="coordJobs">
    <table class="table listing job-listing table-striped table-hover table-bordered">
      <thead>
        <tr>
          <th>Name</th>
          <th>Status</th>
          <th>User</th>
          <th>Group</th>
          <th>Frequency</th>
          <th>Time Unit</th>
          <th>Start Time</th>
          <th>End Time</th>
          <th>Job Id</th>
        </tr>
      </thead>
      <tbody>
        {{#each model.bundleCoordJobs as |coordJob|}}
        <tr class="{{if (eq actionInfo model.actionDetails) "active"}}">
          <td class="pointer action-link" {{action 'showCoord' coordJob.coordJobId}}>{{coordJob.coordJobName}}</td>
          <td>{{coordJob.status}}</td>
          <td>{{coordJob.user}}</td>
          <td>{{coordJob.group}}</td>
          <td>{{coordJob.frequency}}</td>
          <td>{{coordJob.timeUnit}}</td>
          <td>{{coordJob.startTime}}</td>
          <td>{{coordJob.endTime}}</td>
          <td>{{coordJob.coordJobId}}</td>
        </tr>
        {{/each}}
      </tbody>
    </table>
  </div>
  <div role="tabpanel" class="tab-pane" id="jobDefinition">
    <div class="panel panel-default">
      <div class="panel-body preview">
        <pre class="prettyprint">
          {{ivy-codemirror value=jobDefinition options=(hash lineNumbers=false mode="xml" indentWithTabs=true readOnly=true)}}
        </pre>
      </div>
    </div>
  </div>
  <div role="tabpanel" class="tab-pane" id="jobConfig">
    <div class="panel panel-default">
      <div class="panel-body preview">
        <table class="table table-striped configuration-property-table listing">
          <thead>
            <tr>
              <th class="propertyName">Name</th>
              <th class="propertyValue">Value</th>
            </tr>
          </thead>
          <tbody>
            {{#each configurationProperties as |configurationProperty|}}
              <tr>
                <td class="propertyName">{{configurationProperty.name}}</td>
                <td class="propertyValue">{{configurationProperty.value}}</td>
              </tr>
            {{/each}}
          </tbody>
        </table>
      </div>
    </div>
  </div>
  <div role="tabpanel" class="tab-pane" id="jobLog">
    {{#job-log getJobLog="getJobLog" jobType=model.jobType jobLog=model.jobLog error=model.error}}{{/job-log}}
  </div>

  <div role="tabpanel" class="tab-pane" id="jobErrorLog">
    <div class="panel panel-default">
      <div class="panel-body preview">
        {{#if model.errorLog}}
          <pre>{{model.errorLog}}</pre>
        {{else if model.error}}
          <pre>{{model.errorLog}}</pre>
        {{else}}
          {{spin-spinner lines=8 length=5 width=3 radius=5 top=220}}
        {{/if}}
      </div>
    </div>
  </div>
  <div role="tabpanel" class="tab-pane" id="jobAuditLog">
    <div class="panel panel-default">
      <div class="panel-body preview">
        {{#if model.auditLog}}
          <pre>{{model.auditLog}}</pre>
        {{else if model.error}}
          <pre>{{model.auditLog}}</pre>
        {{else}}
          {{spin-spinner lines=8 length=5 width=3 radius=5 top=220}}
        {{/if}}
      </div>
    </div>
  </div>
</div>
